package com.banmoon.facade;

public class ComputerFacade implements ComputerComponent{

    private Cpu cpu;

    private Ddr ddr;

    private PowerSupply ps;

    private Ssd ssd;

    public ComputerFacade() {
        cpu = new Cpu();
        ddr = new Ddr();
        ps = new PowerSupply();
        ssd = new Ssd();
    }


    @Override
    public void open() {
        ps.open();
        cpu.open();
        ddr.open();
        ssd.open();
        System.out.println("==== 电脑启动成功 ====");
    }

    @Override
    public void close() {
        ddr.close();
        cpu.close();
        ssd.close();
        ps.close();
        System.out.println("==== 电脑关闭成功 ====");
    }
}
